<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>test_coos</title>
<script type="text/javascript" src="../scripts/coos.js"></script>
<script type="text/javascript" src="testCoos.js"></script>
</head>
<body>
<script type="text/javascript">
/*
//test coos.Class
var BillGates = new Person("Bill Gates", 53);
var SteveJobs = new Employee("Steve Jobs", 53, 1234);
alert(BillGates);
BillGates.SayHello();
SteveJobs.SayHello();
SteveJobs.ShowMeTheMoney();

var LittleBill = new BillGates.Type("Little Bill", 6); 
LittleBill.SayHello();

alert(BillGates.isA(Person));       //true
alert(BillGates.isA(Employee));     //false
alert(SteveJobs.isA(Person));       //true
*/
/*
//test coos.Interface 
var testInterface = new coos.Interface("testInterface",["getId","getName"]);

function adminUser(user)
{
	coos.Interface.impl(user,testInterface);
	var id = user.getId();
	var name = user.getName();
	var message = "I'm a admin user";
	alert("id = " + id + " name = " + name + " message = " + message);
}

function vipUser(user)
{
	coos.Interface.impl(user,testInterface);
	var id = user.getId();
	var name = user.getName();
	var message = "I'm a vip user";
	alert("id = " + id + " name = " + name + " message = " + message);
}

function user(id,name)
{
	this.getId = function(){return id};
	this.getName = function(){return name};
}

adminUser(new user("1","admin"));
vipUser(new user("2","zdz"));
*/

//test coos.singleton
var sessionFactory = new coos.singleton(
	function(){
		this.message = "I'm a sessionFactory!";
		this.sayHello = function(){alert("Hello!");}
	},"sessionFactory"
);
var mySession = sessionFactory.getInstance();
mySession.sayHello();
var newSession = new sessionFactory();
</script>
</body>
</html>